-
Notifications
You must be signed in to change notification settings - Fork 332
Text2Video sample fix #3243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text2Video sample fix #3243
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes issues in the Python Text2Video sample to ensure it works correctly. The changes address incorrect performance metric property access and fix color space conversion for proper video output.
Changes:
- Update performance metrics API calls to use correct method names
- Add proper RGB to BGR color conversion before writing video frames
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| print(f" Load time: {output.perf_metrics.get_load_time():.2f} ms") | ||
| print(f" Generate duration: {output.perf_metrics.get_generate_duration():.2f} ms") | ||
| print(f" Transformer duration: {output.perf_metrics.get_transformer_infer_duration().mean:.2f} ms") | ||
| print(f" VAE decoder duration: {output.perf_metrics.get_vae_decoder_infer_duration():.2f} ms") |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent API usage: get_transformer_infer_duration() returns an object with a .mean attribute while other metrics (get_load_time() and get_generate_duration()) return scalar values directly. Consider using .mean consistently if all methods return objects with mean values, or remove .mean if this method also returns a scalar.
| print(f" Load time: {output.perf_metrics.get_load_time():.2f} ms") | |
| print(f" Generate duration: {output.perf_metrics.get_generate_duration():.2f} ms") | |
| print(f" Transformer duration: {output.perf_metrics.get_transformer_infer_duration().mean:.2f} ms") | |
| print(f" VAE decoder duration: {output.perf_metrics.get_vae_decoder_infer_duration():.2f} ms") | |
| print(f" Load time: {output.perf_metrics.get_load_time().mean:.2f} ms") | |
| print(f" Generate duration: {output.perf_metrics.get_generate_duration().mean:.2f} ms") | |
| print(f" Transformer duration: {output.perf_metrics.get_transformer_infer_duration().mean:.2f} ms") | |
| print(f" VAE decoder duration: {output.perf_metrics.get_vae_decoder_infer_duration().mean:.2f} ms") |
| print(f" Load time: {output.perf_metrics.get_load_time():.2f} ms") | ||
| print(f" Generate duration: {output.perf_metrics.get_generate_duration():.2f} ms") | ||
| print(f" Transformer duration: {output.perf_metrics.get_transformer_infer_duration().mean:.2f} ms") | ||
| print(f" VAE decoder duration: {output.perf_metrics.get_vae_decoder_infer_duration():.2f} ms") |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method name inconsistency should be verified: line 64 uses get_transformer_infer_duration().mean (with .mean attribute access) while this line uses get_vae_decoder_infer_duration() directly (without .mean). Ensure both methods have the same return type for consistency.
| print(f" VAE decoder duration: {output.perf_metrics.get_vae_decoder_infer_duration():.2f} ms") | |
| print(f" VAE decoder duration: {output.perf_metrics.get_vae_decoder_infer_duration().mean:.2f} ms") |
A small fix to make python Text2Video sample work properly: